#ifndef OBJECT3D_H
#define OBJECT3D_H

#include "GL/glew.h"
#include "Objects/TransformComponent.h"

class GraphicComponent
{
public:
	GraphicComponent(void);
	virtual ~GraphicComponent(void);

	virtual void Draw();

	inline Matrix& GetModelMatrix();
	inline const Matrix& GetModelMatrix() const;

	inline const TransformComponent& GetTransform() const {return *mTransform; }
	inline TransformComponent& GetTransform() {return *mTransform; }

protected:
	GLuint mVertexbuffer;
	GLuint mVertexArrayID;
	GLuint mIndexedBufferObject;

	TransformComponent* mTransform;
};

inline const Matrix& GraphicComponent::GetModelMatrix() const
{
	if (mTransform != NULL)
	{
		return mTransform->GetConstMatrixTransform();
	}
}



#endif // OBJECT3D_H

